      SUBROUTINE HBFILL2(nabvoff)

      IMPLICIT NONE
      
      INCLUDE 'hbcomm.inc'
      INCLUDE 'hbtype.inc'

      INTEGER I,J,K,JJ,UN,IERROR,IFILE,NLOOP
      INTEGER NOENT, OFFSET, NABVOFF

      INTEGER sig1p, sig2p, hsb1p,hsb2p,lsb1p,lsb2p;

      REAL DDD

c      REAL ax1, ax2, st1, st2

      PARAMETER (UN=100)

      EQUIVALENCE (ntr,VEC1(1))
      CHARACTER*120 CHFIN(0:2000)
      
      REAL VEC(12), VEC2(8), VEC3(2)

      real p0,p1,p2,p3,p4,p5,p6,p7,p8,p9,p10
      real p(0:10)
      INTEGER zzz11, zzz21, zzz22
      INTEGER zzz11l, zzz21l, zzz22l
      INTEGER zzz11m, zzz21m, zzz22m
      INTEGER zzz11h, zzz21h, zzz22h
      real weight

      do i=0,10
         p(i)=10**i
      enddo

c     add g cuts here

      weight=0.

      IF (ABS(recmpi1-10.63)<0.04) weight=1.
      If (ABS(recmpi2-10.63)<0.04) weight=weight+1.

      CALL HFILL(NABVOFF+50, recm2pi, egboost, weight)
      CALL HFILL(NABVOFF+60, recm2pi, m2pi, weight)
      CALL HFILL(NABVOFF+70, egboost, m2pi, weight)

      CALL HFILL(NABVOFF+20, recm2pi, egboost, 1.)
      CALL HFILL(NABVOFF+30, recm2pi, m2pi, 1.)
      CALL HFILL(NABVOFF+40, egboost, m2pi, 1.)

      sig1p=0.
      sig2p=0.
      hsb1p=0.
      hsb2p=0.
      lsb1p=0.
      lsb2p=0.

      if(recm2pi.gt.9.87.and.recm2pi.lt.9.93) then
         sig1p=1.
      endif
      if(recm2pi.gt.9.93.and.recm2pi.lt.9.95) then
         hsb1p=1.
      endif
      if(recm2pi.gt.9.85.and.recm2pi.lt.9.87) then
         lsb1p=1.
      endif

c     if(recm2pi.gt.10.24.and.recm2pi.lt.10.28) then
c     if(recm2pi.gt.10.25.and.recm2pi.lt.10.27) then
      if(recm2pi.gt.10.245.and.recm2pi.lt.10.275) then
         sig2p=1.
      endif
      if(recm2pi.gt.10.28.and.recm2pi.lt.10.3) then
         hsb2p=1.
      endif
      if(recm2pi.gt.10.20.and.recm2pi.lt.10.24) then
         lsb2p=1.
      endif

c     code below redudant

c     goto 77
      zzz11 = 0
      zzz21 = 0
      zzz22 = 0

c     2P -> 1 S photon (675 -> 925 MeV)

      do k=7,8
         zzz21=zzz21+(mod(ngam6,p(k))-mod(ngam6,p(k-1)))/p(k-1)
      enddo
      do k=1,8
         zzz21=zzz21+(mod(ngam7,p(k))-mod(ngam7,p(k-1)))/p(k-1)
      enddo
      do k=1,8
         zzz21=zzz21+(mod(ngam8,p(k))-mod(ngam8,p(k-1)))/p(k-1)
      enddo
      do k=1,2
         zzz21=zzz21+(mod(ngam9,p(k))-mod(ngam9,p(k-1)))/p(k-1)
      enddo



c     2P -> 2 S photon (150 -> 350 MeV)
      zzz22=0.
      do k=5,8
         zzz22=zzz22+(mod(ngam1,p(k))-mod(ngam1,p(k-1)))/p(k-1)
      enddo
      do k=1,8
         zzz22=zzz22+(mod(ngam2,p(k))-mod(ngam2,p(k-1)))/p(k-1)
      enddo
      do k=1,4
         zzz22=zzz22+(mod(ngam3,p(k))-mod(ngam3,p(k-1)))/p(k-1)
      enddo


c     1P -> 1 S photon (375 -> 575 MeV)
      zzz11=0.
      do k=7,8
         zzz11=zzz11+(mod(ngam3,p(k))-mod(ngam3,p(k-1)))/p(k-1)
      enddo
      do k=1,8
         zzz11=zzz11+(mod(ngam4,p(k))-mod(ngam4,p(k-1)))/p(k-1)
      enddo
      do k=1,6
         zzz11=zzz11+(mod(ngam5,p(k))-mod(ngam5,p(k-1)))/p(k-1)
      enddo


 77   continue

c     filling histograms for 1P -> 1 S with photon (375 -> 575 MeV)
      offset = 0
      if (zzz11.eq.0) then
c     call hfill(nabvoff+1001+offset,egboost,0.,1.)
c     call hfill(nabvoff+1002+offset,recmg2pi,0.,1.)
c     call hfill(nabvoff+1003+offset,recm2pi-recmg2pi,0.,1.)
         if(sig1p.eq.1.) call hfill(nabvoff+1011+offset,egboost,0.,1.)
         if(lsb1p.eq.1.) call hfill(nabvoff+1012+offset,egboost,0.,1.)
         if(hsb1p.eq.1.) call hfill(nabvoff+1013+offset,egboost,0.,1.)
         if(sig1p.eq.1.) call hfill(nabvoff+1021+offset,recmg2pi-recm2pi+9.8991,0.,1.)
         if(lsb1p.eq.1.) call hfill(nabvoff+1022+offset,recmg2pi-recm2pi+9.8991,0.,1.)
         if(hsb1p.eq.1.) call hfill(nabvoff+1023+offset,recmg2pi-recm2pi+9.8991,0.,1.)


         CALL HFILL(NABVOFF+151, recm2pi, egboost, weight)
         CALL HFILL(NABVOFF+161, recm2pi, m2pi, weight)
         CALL HFILL(NABVOFF+171, egboost, m2pi, weight)

         CALL HFILL(NABVOFF+121, recm2pi, egboost, 1.)
         CALL HFILL(NABVOFF+131, recm2pi, m2pi, 1.)
         CALL HFILL(NABVOFF+141, egboost, m2pi, 1.)



      endif

      offset = 1000
      if (zzz11.eq.1) then
c     call hfill(nabvoff+1001+offset,egboost,0.,1.)
c     call hfill(nabvoff+1002+offset,recmg2pi,0.,1.)
c     call hfill(nabvoff+1003+offset,recm2pi-recmg2pi,0.,1.)
         if(sig1p.eq.1.) call hfill(nabvoff+1011+offset,egboost,0.,1.)
         if(lsb1p.eq.1.) call hfill(nabvoff+1012+offset,egboost,0.,1.)
         if(hsb1p.eq.1.) call hfill(nabvoff+1013+offset,egboost,0.,1.)
         if(sig1p.eq.1.) call hfill(nabvoff+1021+offset,recmg2pi-recm2pi+9.8991,0.,1.)
         if(lsb1p.eq.1.) call hfill(nabvoff+1022+offset,recmg2pi-recm2pi+9.8991,0.,1.)
         if(hsb1p.eq.1.) call hfill(nabvoff+1023+offset,recmg2pi-recm2pi+9.8991,0.,1.)

         CALL HFILL(NABVOFF+51, recm2pi, egboost, weight)
         CALL HFILL(NABVOFF+61, recm2pi, m2pi, weight)
         CALL HFILL(NABVOFF+71, egboost, m2pi, weight)

         CALL HFILL(NABVOFF+21, recm2pi, egboost, 1.)
         CALL HFILL(NABVOFF+31, recm2pi, m2pi, 1.)
         CALL HFILL(NABVOFF+41, egboost, m2pi, 1.)


      endif

      offset = 2000
      if (zzz11.eq.2) then
c     call hfill(nabvoff+1001+offset,egboost,0.,1.)
c     call hfill(nabvoff+1002+offset,recmg2pi,0.,1.)
c     call hfill(nabvoff+1003+offset,recm2pi-recmg2pi,0.,1.)
         if(sig1p.eq.1.) call hfill(nabvoff+1011+offset,egboost,0.,1.)
         if(lsb1p.eq.1.) call hfill(nabvoff+1012+offset,egboost,0.,1.)
         if(hsb1p.eq.1.) call hfill(nabvoff+1013+offset,egboost,0.,1.)
         if(sig1p.eq.1.) call hfill(nabvoff+1021+offset,recmg2pi-recm2pi+9.8991,0.,1.)
         if(lsb1p.eq.1.) call hfill(nabvoff+1022+offset,recmg2pi-recm2pi+9.8991,0.,1.)
         if(hsb1p.eq.1.) call hfill(nabvoff+1023+offset,recmg2pi-recm2pi+9.8991,0.,1.)
      endif


      offset = 3000
      if (zzz11.eq.1.and.(ax1+st1).gt.9.and.(ax2+st2).gt.9) then
c     call hfill(nabvoff+1001+offset,egboost,0.,1.)
c     call hfill(nabvoff+1002+offset,recmg2pi,0.,1.)
c     call hfill(nabvoff+1003+offset,recm2pi-recmg2pi,0.,1.)
         if(sig1p.eq.1.) call hfill(nabvoff+1011+offset,egboost,0.,1.)
         if(lsb1p.eq.1.) call hfill(nabvoff+1012+offset,egboost,0.,1.)
         if(hsb1p.eq.1.) call hfill(nabvoff+1013+offset,egboost,0.,1.)
         if(sig1p.eq.1.) call hfill(nabvoff+1021+offset,recmg2pi-recm2pi+9.8991,0.,1.)
         if(lsb1p.eq.1.) call hfill(nabvoff+1022+offset,recmg2pi-recm2pi+9.8991,0.,1.)
         if(hsb1p.eq.1.) call hfill(nabvoff+1023+offset,recmg2pi-recm2pi+9.8991,0.,1.)
      endif

      offset = 4000
      if (zzz11.eq.1.and.(ax1+st1).gt.9.and.(ax2+st2).gt.9.and.prob2pi.gt.0.) then
c     call hfill(nabvoff+1001+offset,egboost,0.,1.)
c     call hfill(nabvoff+1002+offset,recmg2pi,0.,1.)
c     call hfill(nabvoff+1003+offset,recm2pi-recmg2pi,0.,1.)
         if(sig1p.eq.1.) call hfill(nabvoff+1011+offset,egboost,0.,1.)
         if(lsb1p.eq.1.) call hfill(nabvoff+1012+offset,egboost,0.,1.)
         if(hsb1p.eq.1.) call hfill(nabvoff+1013+offset,egboost,0.,1.)
         if(sig1p.eq.1.) call hfill(nabvoff+1021+offset,recmg2pi-recm2pi+9.8991,0.,1.)
         if(lsb1p.eq.1.) call hfill(nabvoff+1022+offset,recmg2pi-recm2pi+9.8991,0.,1.)
         if(hsb1p.eq.1.) call hfill(nabvoff+1023+offset,recmg2pi-recm2pi+9.8991,0.,1.)
      endif

      offset = 5000
      if (zzz11.eq.1.and.prob2pi.gt.0.) then
c     call hfill(nabvoff+1001+offset,egboost,0.,1.)
c     call hfill(nabvoff+1002+offset,recmg2pi,0.,1.)
c     call hfill(nabvoff+1003+offset,recm2pi-recmg2pi,0.,1.)
         if(sig1p.eq.1.) call hfill(nabvoff+1011+offset,egboost,0.,1.)
         if(lsb1p.eq.1.) call hfill(nabvoff+1012+offset,egboost,0.,1.)
         if(hsb1p.eq.1.) call hfill(nabvoff+1013+offset,egboost,0.,1.)
         if(sig1p.eq.1.) call hfill(nabvoff+1021+offset,recmg2pi-recm2pi+9.8991,0.,1.)
         if(lsb1p.eq.1.) call hfill(nabvoff+1022+offset,recmg2pi-recm2pi+9.8991,0.,1.)
         if(hsb1p.eq.1.) call hfill(nabvoff+1023+offset,recmg2pi-recm2pi+9.8991,0.,1.)
      endif

      offset = 6000
c     if (zzz11.eq.0.and.(ax1+st1).gt.9.and.(ax2+st2).gt.9.and.prob2pi.gt.0.) then
c     call hfill(nabvoff+1001+offset,egboost,0.,1.)
c     call hfill(nabvoff+1002+offset,recmg2pi,0.,1.)
c     call hfill(nabvoff+1003+offset,recm2pi-recmg2pi,0.,1.)
      if(sig1p.eq.1.) call hfill(nabvoff+1011+offset,egboost,0.,1.)
      if(lsb1p.eq.1.) call hfill(nabvoff+1012+offset,egboost,0.,1.)
      if(hsb1p.eq.1.) call hfill(nabvoff+1013+offset,egboost,0.,1.)
      if(sig1p.eq.1.) call hfill(nabvoff+1021+offset,recmg2pi-recm2pi+9.8991,0.,1.)
      if(lsb1p.eq.1.) call hfill(nabvoff+1022+offset,recmg2pi-recm2pi+9.8991,0.,1.)
      if(hsb1p.eq.1.) call hfill(nabvoff+1023+offset,recmg2pi-recm2pi+9.8991,0.,1.)
c     endif


c     filling histograms for 2P -> 1 S

      offset = 10000
      if (zzz21.eq.0) then
c     call hfill(nabvoff+1001+offset,egboost,0.,1.)
c     call hfill(nabvoff+1002+offset,recmg2pi,0.,1.)
c     call hfill(nabvoff+1003+offset,recm2pi-recmg2pi,0.,1.)
         if(sig2p.eq.1.) call hfill(nabvoff+1011+offset,egboost,0.,1.)
         if(lsb2p.eq.1.) call hfill(nabvoff+1012+offset,egboost,0.,1.)
         if(hsb2p.eq.1.) call hfill(nabvoff+1013+offset,egboost,0.,1.)
         if(sig2p.eq.1.) call hfill(nabvoff+1021+offset,recmg2pi-recm2pi+10.2598,0.,1.)
         if(lsb2p.eq.1.) call hfill(nabvoff+1022+offset,recmg2pi-recm2pi+10.2598,0.,1.)
         if(hsb2p.eq.1.) call hfill(nabvoff+1023+offset,recmg2pi-recm2pi+10.2598,0.,1.)


         CALL HFILL(NABVOFF+152, recm2pi, egboost, weight)
         CALL HFILL(NABVOFF+162, recm2pi, m2pi, weight)
         CALL HFILL(NABVOFF+172, egboost, m2pi, weight)

         CALL HFILL(NABVOFF+122, recm2pi, egboost, 1.)
         CALL HFILL(NABVOFF+132, recm2pi, m2pi, 1.)
         CALL HFILL(NABVOFF+142, egboost, m2pi, 1.)


      endif

      offset = 11000
      if (zzz21.eq.1) then
c     call hfill(nabvoff+1001+offset,egboost,0.,1.)
c     call hfill(nabvoff+1002+offset,recmg2pi,0.,1.)
c     call hfill(nabvoff+1003+offset,recm2pi-recmg2pi,0.,1.)
         if(sig2p.eq.1.) call hfill(nabvoff+1011+offset,egboost,0.,1.)
         if(lsb2p.eq.1.) call hfill(nabvoff+1012+offset,egboost,0.,1.)
         if(hsb2p.eq.1.) call hfill(nabvoff+1013+offset,egboost,0.,1.)
         if(sig2p.eq.1.) call hfill(nabvoff+1021+offset,recmg2pi-recm2pi+10.2598,0.,1.)
         if(lsb2p.eq.1.) call hfill(nabvoff+1022+offset,recmg2pi-recm2pi+10.2598,0.,1.)
         if(hsb2p.eq.1.) call hfill(nabvoff+1023+offset,recmg2pi-recm2pi+10.2598,0.,1.)

         CALL HFILL(NABVOFF+52, recm2pi, egboost, weight)
         CALL HFILL(NABVOFF+62, recm2pi, m2pi, weight)
         CALL HFILL(NABVOFF+72, egboost, m2pi, weight)

         CALL HFILL(NABVOFF+22, recm2pi, egboost, 1.)
         CALL HFILL(NABVOFF+32, recm2pi, m2pi, 1.)
         CALL HFILL(NABVOFF+42, egboost, m2pi, 1.)


      endif


      offset = 12000
      if (zzz21.eq.2) then
c     call hfill(nabvoff+1001+offset,egboost,0.,1.)
c     call hfill(nabvoff+1002+offset,recmg2pi,0.,1.)
c     call hfill(nabvoff+1003+offset,recm2pi-recmg2pi,0.,1.)
         if(sig2p.eq.1.) call hfill(nabvoff+1011+offset,egboost,0.,1.)
         if(lsb2p.eq.1.) call hfill(nabvoff+1012+offset,egboost,0.,1.)
         if(hsb2p.eq.1.) call hfill(nabvoff+1013+offset,egboost,0.,1.)
         if(sig2p.eq.1.) call hfill(nabvoff+1021+offset,recmg2pi-recm2pi+10.2598,0.,1.)
         if(lsb2p.eq.1.) call hfill(nabvoff+1022+offset,recmg2pi-recm2pi+10.2598,0.,1.)
         if(hsb2p.eq.1.) call hfill(nabvoff+1023+offset,recmg2pi-recm2pi+10.2598,0.,1.)
      endif


      offset = 13000
      if (zzz21.eq.1.and.(ax1+st1).gt.9.and.(ax2+st2).gt.9) then
c     call hfill(nabvoff+1001+offset,egboost,0.,1.)
c     call hfill(nabvoff+1002+offset,recmg2pi,0.,1.)
c     call hfill(nabvoff+1003+offset,recm2pi-recmg2pi,0.,1.)
         if(sig2p.eq.1.) call hfill(nabvoff+1011+offset,egboost,0.,1.)
         if(lsb2p.eq.1.) call hfill(nabvoff+1012+offset,egboost,0.,1.)
         if(hsb2p.eq.1.) call hfill(nabvoff+1013+offset,egboost,0.,1.)
         if(sig2p.eq.1.) call hfill(nabvoff+1021+offset,recmg2pi-recm2pi+10.2598,0.,1.)
         if(lsb2p.eq.1.) call hfill(nabvoff+1022+offset,recmg2pi-recm2pi+10.2598,0.,1.)
         if(hsb2p.eq.1.) call hfill(nabvoff+1023+offset,recmg2pi-recm2pi+10.2598,0.,1.)
      endif
      offset = 14000
      if (zzz21.eq.1.and.(ax1+st1).gt.9.and.(ax2+st2).gt.9.and.prob2pi.gt.0.) then
c     call hfill(nabvoff+1001+offset,egboost,0.,1.)
c     call hfill(nabvoff+1002+offset,recmg2pi,0.,1.)
c     call hfill(nabvoff+1003+offset,recm2pi-recmg2pi,0.,1.)
         if(sig2p.eq.1.) call hfill(nabvoff+1011+offset,egboost,0.,1.)
         if(lsb2p.eq.1.) call hfill(nabvoff+1012+offset,egboost,0.,1.)
         if(hsb2p.eq.1.) call hfill(nabvoff+1013+offset,egboost,0.,1.)
         if(sig2p.eq.1.) call hfill(nabvoff+1021+offset,recmg2pi-recm2pi+10.2598,0.,1.)
         if(lsb2p.eq.1.) call hfill(nabvoff+1022+offset,recmg2pi-recm2pi+10.2598,0.,1.)
         if(hsb2p.eq.1.) call hfill(nabvoff+1023+offset,recmg2pi-recm2pi+10.2598,0.,1.)
      endif
      offset = 15000
      if (zzz21.eq.1.and.prob2pi.gt.0.) then
c     call hfill(nabvoff+1001+offset,egboost,0.,1.)
c     call hfill(nabvoff+1002+offset,recmg2pi,0.,1.)
c     call hfill(nabvoff+1003+offset,recm2pi-recmg2pi,0.,1.)
         if(sig2p.eq.1.) call hfill(nabvoff+1011+offset,egboost,0.,1.)
         if(lsb2p.eq.1.) call hfill(nabvoff+1012+offset,egboost,0.,1.)
         if(hsb2p.eq.1.) call hfill(nabvoff+1013+offset,egboost,0.,1.)
         if(sig2p.eq.1.) call hfill(nabvoff+1021+offset,recmg2pi-recm2pi+10.2598,0.,1.)
         if(lsb2p.eq.1.) call hfill(nabvoff+1022+offset,recmg2pi-recm2pi+10.2598,0.,1.)
         if(hsb2p.eq.1.) call hfill(nabvoff+1023+offset,recmg2pi-recm2pi+10.2598,0.,1.)
      endif

      offset = 16000
c     if (zzz21.eq.0.and.(ax1+st1).gt.9.and.(ax2+st2).gt.9.and.prob2pi.gt.0.) then
c     call hfill(nabvoff+1001+offset,egboost,0.,1.)
c     call hfill(nabvoff+1002+offset,recmg2pi,0.,1.)
c     call hfill(nabvoff+1003+offset,recm2pi-recmg2pi,0.,1.)
      if(sig2p.eq.1.) call hfill(nabvoff+1011+offset,egboost,0.,1.)
      if(lsb2p.eq.1.) call hfill(nabvoff+1012+offset,egboost,0.,1.)
      if(hsb2p.eq.1.) call hfill(nabvoff+1013+offset,egboost,0.,1.)
      if(sig2p.eq.1.) call hfill(nabvoff+1021+offset,recmg2pi-recm2pi+10.2598,0.,1.)
      if(lsb2p.eq.1.) call hfill(nabvoff+1022+offset,recmg2pi-recm2pi+10.2598,0.,1.)
      if(hsb2p.eq.1.) call hfill(nabvoff+1023+offset,recmg2pi-recm2pi+10.2598,0.,1.)
c     endif

c     filling histograms for 2P -> 2 S
      offset = 20000
      if (zzz22.eq.0) then
c     call hfill(nabvoff+1001+offset,egboost,0.,1.)
c     call hfill(nabvoff+1002+offset,recmg2pi,0.,1.)
c     call hfill(nabvoff+1003+offset,recm2pi-recmg2pi,0.,1.)
         if(sig2p.eq.1.) call hfill(nabvoff+1011+offset,egboost,0.,1.)
         if(lsb2p.eq.1.) call hfill(nabvoff+1012+offset,egboost,0.,1.)
         if(hsb2p.eq.1.) call hfill(nabvoff+1013+offset,egboost,0.,1.)
         if(sig2p.eq.1.) call hfill(nabvoff+1021+offset,recmg2pi-recm2pi+10.2598,0.,1.)
         if(lsb2p.eq.1.) call hfill(nabvoff+1022+offset,recmg2pi-recm2pi+10.2598,0.,1.)
         if(hsb2p.eq.1.) call hfill(nabvoff+1023+offset,recmg2pi-recm2pi+10.2598,0.,1.)

         CALL HFILL(NABVOFF+153, recm2pi, egboost, weight)
         CALL HFILL(NABVOFF+163, recm2pi, m2pi, weight)
         CALL HFILL(NABVOFF+173, egboost, m2pi, weight)

         CALL HFILL(NABVOFF+123, recm2pi, egboost, 1.)
         CALL HFILL(NABVOFF+133, recm2pi, m2pi, 1.)
         CALL HFILL(NABVOFF+143, egboost, m2pi, 1.)

      endif

      offset = 21000
      if (zzz22.eq.1) then
c     call hfill(nabvoff+1001+offset,egboost,0.,1.)
c     call hfill(nabvoff+1002+offset,recmg2pi,0.,1.)
c     call hfill(nabvoff+1003+offset,recm2pi-recmg2pi,0.,1.)
         if(sig2p.eq.1.) call hfill(nabvoff+1011+offset,egboost,0.,1.)
         if(lsb2p.eq.1.) call hfill(nabvoff+1012+offset,egboost,0.,1.)
         if(hsb2p.eq.1.) call hfill(nabvoff+1013+offset,egboost,0.,1.)
         if(sig2p.eq.1.) call hfill(nabvoff+1021+offset,recmg2pi-recm2pi+10.2598,0.,1.)
         if(lsb2p.eq.1.) call hfill(nabvoff+1022+offset,recmg2pi-recm2pi+10.2598,0.,1.)
         if(hsb2p.eq.1.) call hfill(nabvoff+1023+offset,recmg2pi-recm2pi+10.2598,0.,1.)

         CALL HFILL(NABVOFF+53, recm2pi, egboost, weight)
         CALL HFILL(NABVOFF+63, recm2pi, m2pi, weight)
         CALL HFILL(NABVOFF+73, egboost, m2pi, weight)

         CALL HFILL(NABVOFF+23, recm2pi, egboost, 1.)
         CALL HFILL(NABVOFF+33, recm2pi, m2pi, 1.)
         CALL HFILL(NABVOFF+43, egboost, m2pi, 1.)


      endif


      offset = 22000
      if (zzz22.eq.2) then
c     call hfill(nabvoff+1001+offset,egboost,0.,1.)
c     call hfill(nabvoff+1002+offset,recmg2pi,0.,1.)
c     call hfill(nabvoff+1003+offset,recm2pi-recmg2pi,0.,1.)
         if(sig2p.eq.1.) call hfill(nabvoff+1011+offset,egboost,0.,1.)
         if(lsb2p.eq.1.) call hfill(nabvoff+1012+offset,egboost,0.,1.)
         if(hsb2p.eq.1.) call hfill(nabvoff+1013+offset,egboost,0.,1.)
         if(sig2p.eq.1.) call hfill(nabvoff+1021+offset,recmg2pi-recm2pi+10.2598,0.,1.)
         if(lsb2p.eq.1.) call hfill(nabvoff+1022+offset,recmg2pi-recm2pi+10.2598,0.,1.)
         if(hsb2p.eq.1.) call hfill(nabvoff+1023+offset,recmg2pi-recm2pi+10.2598,0.,1.)
      endif


      offset = 23000
      if (zzz22.eq.1.and.(ax1+st1).gt.9.and.(ax2+st2).gt.9) then
c     call hfill(nabvoff+1001+offset,egboost,0.,1.)
c     call hfill(nabvoff+1002+offset,recmg2pi,0.,1.)
c     call hfill(nabvoff+1003+offset,recm2pi-recmg2pi,0.,1.)
         if(sig2p.eq.1.) call hfill(nabvoff+1011+offset,egboost,0.,1.)
         if(lsb2p.eq.1.) call hfill(nabvoff+1012+offset,egboost,0.,1.)
         if(hsb2p.eq.1.) call hfill(nabvoff+1013+offset,egboost,0.,1.)
         if(sig2p.eq.1.) call hfill(nabvoff+1021+offset,recmg2pi-recm2pi+10.2598,0.,1.)
         if(lsb2p.eq.1.) call hfill(nabvoff+1022+offset,recmg2pi-recm2pi+10.2598,0.,1.)
         if(hsb2p.eq.1.) call hfill(nabvoff+1023+offset,recmg2pi-recm2pi+10.2598,0.,1.)
      endif

      offset = 24000
      if (zzz22.eq.1.and.(ax1+st1).gt.9.and.(ax2+st2).gt.9.and.prob2pi.gt.0.) then
c     call hfill(nabvoff+1001+offset,egboost,0.,1.)
c     call hfill(nabvoff+1002+offset,recmg2pi,0.,1.)
c     call hfill(nabvoff+1003+offset,recm2pi-recmg2pi,0.,1.)
         if(sig2p.eq.1.) call hfill(nabvoff+1011+offset,egboost,0.,1.)
         if(lsb2p.eq.1.) call hfill(nabvoff+1012+offset,egboost,0.,1.)
         if(hsb2p.eq.1.) call hfill(nabvoff+1013+offset,egboost,0.,1.)
         if(sig2p.eq.1.) call hfill(nabvoff+1021+offset,recmg2pi-recm2pi+10.2598,0.,1.)
         if(lsb2p.eq.1.) call hfill(nabvoff+1022+offset,recmg2pi-recm2pi+10.2598,0.,1.)
         if(hsb2p.eq.1.) call hfill(nabvoff+1023+offset,recmg2pi-recm2pi+10.2598,0.,1.)
      endif

      offset = 25000
      if (zzz22.eq.1.and.prob2pi.gt.0.) then
c     call hfill(nabvoff+1001+offset,egboost,0.,1.)
c     call hfill(nabvoff+1002+offset,recmg2pi,0.,1.)
c     call hfill(nabvoff+1003+offset,recm2pi-recmg2pi,0.,1.)
         if(sig2p.eq.1.) call hfill(nabvoff+1011+offset,egboost,0.,1.)
         if(lsb2p.eq.1.) call hfill(nabvoff+1012+offset,egboost,0.,1.)
         if(hsb2p.eq.1.) call hfill(nabvoff+1013+offset,egboost,0.,1.)
         if(sig2p.eq.1.) call hfill(nabvoff+1021+offset,recmg2pi-recm2pi+10.2598,0.,1.)
         if(lsb2p.eq.1.) call hfill(nabvoff+1022+offset,recmg2pi-recm2pi+10.2598,0.,1.)
         if(hsb2p.eq.1.) call hfill(nabvoff+1023+offset,recmg2pi-recm2pi+10.2598,0.,1.)
      endif

      offset = 26000
c     if (zzz22.eq.0.and.(ax1+st1).gt.9.and.(ax2+st2).gt.9.and.prob2pi.gt.0.) then
c     call hfill(nabvoff+1001+offset,egboost,0.,1.)
c     call hfill(nabvoff+1002+offset,recmg2pi,0.,1.)
c     call hfill(nabvoff+1003+offset,recm2pi-recmg2pi,0.,1.)
      if(sig2p.eq.1.) call hfill(nabvoff+1011+offset,egboost,0.,1.)
      if(lsb2p.eq.1.) call hfill(nabvoff+1012+offset,egboost,0.,1.)
      if(hsb2p.eq.1.) call hfill(nabvoff+1013+offset,egboost,0.,1.)
      if(sig2p.eq.1.) call hfill(nabvoff+1021+offset,recmg2pi-recm2pi+10.2598,0.,1.)
      if(lsb2p.eq.1.) call hfill(nabvoff+1022+offset,recmg2pi-recm2pi+10.2598,0.,1.)
      if(hsb2p.eq.1.) call hfill(nabvoff+1023+offset,recmg2pi-recm2pi+10.2598,0.,1.)
c     endif

      RETURN
      END
